
Coding
-
Animations/save game
//All codes are based on C#.
Uses a format similar to XML to save games.
Using IEnumerator for Animations.
//Uses “Lerp” and “Cos” function to create a slow-in
and slow-out effect.
//This IEnumerator is in the super class “LWElements”
for most classes in this project.
//LWElements inherits MonoBehaviour.
//“GetTag(string str, string tag)” is a method that
returns a string surrounded by a certain tag in the first
string parameter.
//Int(string str) converts a string into int.
//There are also methods not shown in this page like
“SaveCard”, “LoadCharacter”, “LoadPLayer” etc.
Uses StreamReader and StreamWriter class to
read & write files.
Saves the coroutine of each attribute’s animation in a
private variable, so when an animation is called when the
former animation is not completed, the former one can be
stopped.